<?php
$country_name = $_POST['country'];
$region_name = $_POST['region'];
$lat = $_POST['lat'];
$long = $_POST['long'];
include "class/Country.class.php";
include "class/Region.class.php";

$country = new Country();
$check = $country->check_if_exists($country_name);
if($check == -1) {
	$result = -1;
} else {
	$region = new Region();
	$result = $region->add_region($region_name, $check, $lat, $long);
}
echo $result;	
?>